package com.appshelves.utils;


public class Profiler {

    private static final String LOG_TAG = "PROFILER";
    private String caption;
    private long start;

    public Profiler(Object obj, String caption) {
        this(obj.getClass(), caption);
    }

    public Profiler(Class<?> cls, String caption) {
        this.caption = cls.getSimpleName() + ": " + caption;
        this.start = System.currentTimeMillis();
    }

    public void e() {
        long end = System.currentTimeMillis();
        Utils.log(LOG_TAG, caption + " " + (end - start));
    }
}
